/*
 * Copyright (c) 2005-2007 FeaySoft Inc. All Rights Reserved.
 */
package com.feyaSoft.plugin.util.mail;

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

/**
 * @author Fenqiang Zhuang
 * 
 */
public abstract class SimpleMailSender {
	protected abstract MailSender getMailSender();

	public void sendMessage(String to, String text, String subject) {
		SimpleMailMessage msg = new SimpleMailMessage();
		msg.setTo(to);
		msg.setSubject(subject);
		// I do not know whether need @....TODO
		msg.setFrom("no_reply");
		msg.setText(text);

		MailSender sender = getMailSender();
		sender.send(msg);
	}
}
